<template>
  <KView class="page-header">
    <span>{{title}}</span>
    <KView class="page-header-back" @click="backClick">
      <sys-svg name="arrowLeft"></sys-svg>
    </KView>
    <slot></slot>
  </KView>
</template>

<script>
  import SysSvg from 'common/sysSvg';

  export default {
    props: {
      title: {
        type: String,
        required: true
      }
    },

    data() {
      return {};
    },

    methods: {
      backClick() {
        this.$emit('back-click');
      }
    },

    components:{
      SysSvg
    }
  };

</script>

<style lang="scss">
  .page-header {
    padding-top: formatPx(20);
    height: formatPx(40);
    text-align: center;
    font-size: formatPx(36);
    line-height: formatPx(40);
    position: relative;

    .page-header-back {
      position: absolute;
      width: formatPx(36);
      left: formatPx(30);
      top: formatPx(20);
      bottom: 0;
    }
  }

</style>
